<template>
	<view class="top">

		<view v-for="(item,index) in pjList" :key="index">
			<uni-card style="border-radius: 10px;margin-top:0px;height: 160px;">
				<view class="tit">
					<text>{{item.cheUser.realName}}</text>
					<button class="button" @click="detail_btn(item.id)">查看详情</button>
				</view>
				<u-divider text=""></u-divider>
				<view>
					<view style="color: #3486FD;margin-top: 5px;">订单编号：{{item.cheOrder.number}}</view>
					<view style="display: flex;font-weight: bold;margin-top: 5px;">综合评分：{{item.star}}分
						<uni-rate size="18" :value="item.star" />
					</view>
					<view style="font-size: 10px;margin-top: 5px;">评价时间：{{item.commentTime}}</view>
				</view>
			</uni-card>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				OrderList: [],
				pjList: []
			}
		},
		onLoad() {
			this.getOrderList();
			this.getpjList();
		},
		methods: {
			getOrderList() {
				let that = this;
				this.$http({
					url: '/api/management/management/list',
					method: 'GET',
					success(res) {
						console.log(res)
						that.OrderList = res.data.rows
						console.log('===============')
						console.log(that.OrderList)
					}
				})
			},
			getpjList() {
				let that = this;
				this.$http({
					url: '/api/orders/orders/list',
					method: 'GET',
					success(res) {
						console.log(res)
						that.pjList = res.data.rows
						console.log('===============')
						console.log(that.pjList)
					}
				})
			},
			detail_btn(id) {
				uni.$u.route(`/pages/ly/appraise/orderreview?id=${id}`)
			}
		}
	}
</script>

<style scoped>
	.top {
		height: 150px;
		background-image: url(../../../static/images/ly/组 6.png);
	}

	.button {
		height: 22px;
		width: 100px;
		font-size: 12px;
		background-color: #3486FD;
		border-radius: 20px;
		display: flex;
		justify-content: center;
		align-items: center;
		color: white;
		margin-right: 0px;
	}

	.tit {
		font-size: 16px;
		font-weight: bold;
		display: flex;
		justify-content: space-between;
	}
</style>